﻿// See https://aka.ms/new-console-template for more information

while (true)
{
    Console.Clear();
    //显示当前作业
    Homework.ShowHWList();
    //显示干啥
    Console.WriteLine("A: 记作业；B：完成作业；C：删除作业");
    Console.WriteLine("输入相应的编号，执行你干的事");
    string op = Console.ReadLine();
    if (op == "A")
    {
        Console.WriteLine("请输入科目（语文，数学，英语）：");
        string subject = Console.ReadLine();
        Console.WriteLine("请输入作业内容：");
        string content = Console.ReadLine();
        Homework.RememberHW(subject, content);
    }
    if (op == "B")
    {
        //done
        Console.WriteLine("请输入作业编号");
        int index=int.Parse( Console.ReadLine());
        Homework.FinishHW(index);
    }
    if (op == "C")
    {
        //remove
        Console.WriteLine("请输入作业编号");
        int index = int.Parse(Console.ReadLine());
        Homework.RemoveHW(index);
    }

   
    
}



class Homework
{
    public string Subject { get; set; }
    public string Content { get; set; }
    public bool Status { get; set; }


    //作业本
    public static List<Homework> homeworks = new List<Homework>();

    /// <summary>
    /// 记作业
    /// </summary>
    /// <param name="subject"></param>
    /// <param name="content"></param>
    public static void RememberHW(string subject, string content)
    {
        Homework chineseHW = new Homework();
        chineseHW.Subject = subject;
        chineseHW.Content = content;
        chineseHW.Status = false;
        homeworks.Add(chineseHW);
    }

    public static void FinishHW(int index)
    {
        Homework homework = homeworks[index];
        homework.Status = true;
    }

    public static void RemoveHW(int index)
    {
        homeworks.RemoveAt(index);
    }

    /// <summary>
    /// 显示所有作业
    /// </summary>
    public static void ShowHWList()
    {
        Console.WriteLine(string.Format("{3}___{0}___{1}___{2}", "Status", "Subject", "Content","Index"));
        int index = 0;
        foreach (Homework item in homeworks)
        {
            Console.WriteLine(string.Format("{3}___{0}___{1}___{2}", item.Status, item.Subject, item.Content,index));
            index++;
        }
    }

}













////int[] array= new int[2];//声明一个数组，长度为2，
//List<int> list=new List<int>();

//int num=int.Parse(Console.ReadLine());
////array[0] = num;
//list.Add(num);

//int num1 = int.Parse(Console.ReadLine());
////array[1] = num1;
//list.Add(num1);

//int num2 = int.Parse(Console.ReadLine());
////array = ExtentArray(array,num2);
//list.Add(num2);

//int num3 = int.Parse(Console.ReadLine());
////array = ExtentArray(array, num3);
//list.Add(num3);

//list[1] = 45;
//list.Insert(1, 1000);

//list.RemoveAt(3);

//list.AddRange(new List<int> { 5,6,7});

////for (int i = 0; i < array.Length; i++)
////{
////    Console.WriteLine(array[i]);
////}

////for(int i = 0; i < list.Count; i++)
////{
////    Console.WriteLine(list[i]);
////}

//foreach(int item in list)
//{
//    Console.WriteLine(item);
//}







//static int[] ExtentArray(int[] oldArray,int num)
//{
//    int[] newArray = new int[oldArray.Length+1];
//    for (int i = 0; i < oldArray.Length; i++)
//    {
//        newArray[i] = oldArray[i];
//    }
//    newArray[newArray.Length-1]=num;
//    return newArray;
//}

